<template>
  <div class="app-container">

    <SearchContent :queryParams="queryParams" @query="handleQuery" @reset="resetQuery">
      <el-col :span="6">
        <el-form-item label="主订单号:" prop="contractReportNumber">
          <el-input v-model="queryParams.contractReportNumber" clearable placeholder="请输入合同禀议编号"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="车牌号/车架号:" prop="carNoVinNo">
          <el-input v-model="queryParams.carNoVinNo" clearable placeholder="请输入车牌号/车架号"></el-input>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="还车类别:" prop="workOrderStatus">
          <el-select v-model="queryParams.workOrderStatus" placeholder="请选择工单状态">

          </el-select>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="还车时间:" prop="workOrderStatus">
          <el-select v-model="queryParams.workOrderStatus" placeholder="请选择工单状态">

          </el-select>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="退保状态:" prop="workOrderStatus">
          <el-select v-model="queryParams.workOrderStatus" placeholder="请选择工单状态">

          </el-select>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="财务状态:" prop="workOrderStatus">
          <el-select v-model="queryParams.workOrderStatus" placeholder="请选择工单状态">

          </el-select>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="客户名称:" prop="customerName">
          <el-input v-model="queryParams.customerName" clearable placeholder="请输入客户名称"></el-input>
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="车辆归属:">
          <el-select filterable v-model="queryParams.ascriptionId" clearable placeholder="请选择车辆归属"
                     style="width: 100%">

            <el-option v-for="item in companyOriginList" :label="item.deptName" :value="item.deptId"
                       :key="item.deptId"/>

          </el-select>
        </el-form-item>
      </el-col>

    </SearchContent>

    <div class="card-wrap card-padding">
      <div class="table-title-wrap justify-end">

        <e-button type="primary" size="mini"
                  v-hasPermi="['returnMargin:index:batch']"
                  @click="handleBatch">
          合并退保
        </e-button>
        <e-button type="primary" size="mini"
                  v-hasPermi="['returnMargin:index:derive']"
                  @click="handleDerive">导出</e-button>

      </div>
      <table-page :loading="loading" :dataList="dataList" :total="total" :page.sync="queryParams.pageNum"
                  :limit.sync="queryParams.pageSize" @setSizeCurrent="handleList" :isSelect="true"
                  @selectionChange="handleSelectionChange" border>
        <template slot="tableColAc">
          <el-table-column label="操作" align="center" fixed="left" width="100">
            <template slot-scope="{row}">
              <el-button size="mini" type="text" v-hasPermi="['returnMargin:index:view']"
                         @click="handleView(row, 'view')">查看
              </el-button>

              <el-button size="mini" type="text" v-hasPermi="['returnMargin:index:work']"
                         @click="handleWork(row)">退保
              </el-button>

            </template>
          </el-table-column>

        </template>

        <template slot="tableCol">
          <el-table-column align="center" label="主订单号" width="220">
            <template #default="{row}">
            </template>
          </el-table-column>

          <el-table-column align="center" label="车牌号" min-width="100" prop="carNo"/>

          <el-table-column align="center" label="退保状态" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="财务状态" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="所属公司" show-overflow-tooltip min-width="160" prop="ascription"/>

          <el-table-column align="center" label="客户名称" width="160" show-overflow-tooltip prop="customerName"/>

          <el-table-column align="center" label="还车时间" width="140">
            <template slot-scope="{row}">
              {{ row.processedByTime ? $dayjs(row.processedByTime).format('YYYY-MM-DD') : '' }}
            </template>
          </el-table-column>

          <el-table-column align="center" label="还车类型" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="欠租" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="尾款" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="车损费" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="加速折旧费" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="违章费用" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="违约金" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="超里程费" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="其他扣款费用" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="客户理赔款" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="减免金额" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="保证金" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="是否使用保证金抵扣" width="150">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="应退金额" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="补缴金额" width="130">
            <template #default="{row}">

            </template>
          </el-table-column>

          <el-table-column align="center" label="补缴金额" width="130"/>

        </template>
      </table-page>
    </div>

  </div>
</template>

<script>
import SearchContent from "@/components/SearchContent/index.vue";
import {listDept} from "@/api/system/dept";

export default {
  name: 'ReturnMarginList',//还车退保证金列表
  components: {
    SearchContent
  },
  computed: {},
  watch: {},
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      total: 0,
      loading: false,
      dataList: [
        {carNo: '656223'}
      ],
      companyOriginList: []
    };
  },
  created() {
    this.getCompanyOrigin();
  },
  mounted() {
  },
  methods: {
    getCompanyOrigin() {
      listDept({
        deptType: "2", //组织类型（1部门 2公司）
        regionId: null, //所在城市（省市区id）
      }).then((res) => {
        this.companyOriginList = res.data;
      });
    },

    handleList() {

    },

    handleSelectionChange() {

    },

    handleView(row) {
      this._toPage({
        path: "/ReturnCar/ReturnMarginDetails",
        name: 'ReturnMarginDetails',
      });
    },

    handleWork(row) {
      this._toPage({
        path: "/ReturnCar/ReturnMarginInsurance",
        name: 'ReturnMarginInsurance',
      });
    },

    handleQuery() {

    },

    resetQuery() {

    },


    handleBatch() {
      this._toPage({
        path: "/ReturnCar/ReturnMarginMerge",
        name: 'ReturnMarginMerge',
      });
    },

    handleDerive() {

    },
  },
};
</script>

<style scoped lang=""></style>


